package com.yongchun.commons.enums;

/**
 * @author afeng
 * @version 1.0
 * @date 2023/2/16 下午5:29
 */
public enum ChargeRecordsStatusEnum {


    // 支付状态 0 新发起 1 发送成功 2 发送失败 3 支付成功 4 成功回掉成功 5成功回掉失败

    NEW(0, "新支付"),
    SEND_SUCCESS(1, "发起成功"),
    SEND_FAIL(2, "发起失败"),
    PAYED_SUCCESS(3, "支付成功"),
    PAY_SEND_SUCCESS(4, "发送成功"),
    PAY_SEND_FAIL(5, "发送失败"),
    PAY_FAIL(6, "支付失败"),
    SIGN_FAIL(7, "验签失败"),
    NEW_REFUND(8, "退款发起"),
    REFUND_SUCCESS(9, "退款成功"),
    REFUND_SIGN_SUCCESS(10, "退款验签成功"),
    REFUND_SIGN_FAIL(11, "退款验签失败"),
    REFUND_FAIL(12, "退款失败")

            ;

    private int type;
    private String desc;

    ChargeRecordsStatusEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getChargeRecordsStatusDesc(int type) {

        for (ChargeRecordsStatusEnum var : ChargeRecordsStatusEnum.values()) {
            if (type == var.getType())
                return var.getDesc();
        }
        return "新发起";
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
